/* ========================================
   COMPLETE FIXED CSS - ALL ISSUES RESOLVED
   Copy this ENTIRE file
   ======================================== */

/* === CSS VARIABLES === */
:root {
    --primary: #1c8fa6;
    --primary-hover: #167a8e;
    --primary-light: rgba(28, 143, 166, 0.1);
    --accent: #F59E0B;
    --bg-light: #fcfdfd;
    --bg-gray: #f8fafb;
    --text-dark: #1a1a1a;
    --text-gray: #666;
    --text-light: #999;
    --border: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* ========================================
   HERO SECTION
   ======================================== */

.blog-hero {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed;
    padding: 100px 20px !important;
    min-height: 500px !important;
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Decorative Pattern */
.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* Badge */
.blog-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    padding: 10px 24px !important;
    border-radius: 50px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    margin-bottom: 24px !important;
    animation: fadeInDown 0.6s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Badge Dot */
.blog-badge span {
    width: 8px !important;
    height: 8px !important;
    background: #fff !important;
    border-radius: 50% !important;
    display: block !important;
    flex-shrink: 0 !important;
    animation: pulse 2s infinite !important;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.5; 
        transform: scale(0.8); 
    }
}

/* Hero Title */
.blog-hero-title {
    font-size: 56px !important;
    line-height: 1.2 !important;
    color: #fff !important;
    margin-bottom: 20px !important;
    font-weight: 800 !important;
    animation: fadeInUp 0.6s ease 0.1s backwards;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5) !important;
}

.blog-hero-title .text-primary {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 2px 15px rgba(28, 143, 166, 0.8) !important;
}

.blog-hero-desc {
    font-size: 18px !important;
    line-height: 1.7 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    max-width: 700px !important;
    margin: 0 auto 40px !important;
    animation: fadeInUp 0.6s ease 0.2s backwards;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3) !important;
}

/* Search Wrapper */
.blog-search-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease 0.3s backwards;
    display: flex !important;
    align-items: center !important;
}

/* Search Icon */
.blog-search-icon {
    position: absolute !important;
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    color: var(--text-light) !important;
    pointer-events: none !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.blog-search-icon svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Search Input - FIXED */
.blog-search-input {
    width: 100% !important;
    padding: 18px 150px 18px 56px !important;
    border: 2px solid transparent !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    font-size: 16px !important;
    color: var(--text-dark) !important;
    box-shadow: var(--shadow-md) !important;
    transition: var(--transition) !important;
    outline: none !important;
    font-family: inherit !important;
    backdrop-filter: blur(10px);
}

.blog-search-input:focus {
    box-shadow: 0 4px 20px rgba(28, 143, 166, 0.15) !important;
    border-color: var(--primary-light) !important;
    transform: translateY(-2px) !important;
    background: #fff !important;
}

.blog-search-input::placeholder {
    color: var(--text-light) !important;
}

/* Search Button - FIXED */
.blog-search-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 12px 28px !important;
    background: var(--text-dark) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    z-index: 10 !important;
    white-space: nowrap !important;
}

.blog-search-btn:hover {
    background: var(--primary) !important;
    transform: translateY(-50%) scale(1.05) !important;
}

.blog-search-btn:active {
    transform: translateY(-50%) scale(0.98) !important;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   CATEGORY NAVIGATION
   ======================================== */

.blog-category-nav {
    background: #fff;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    /* z-index: 1000; */
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.blog-categories {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-cat-btn {
    padding: 10px 24px;
    background: var(--bg-gray);
    color: var(--text-gray);
    border: 1px solid transparent;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    outline: none;
}

.blog-cat-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.blog-cat-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(28, 143, 166, 0.25);
    border-color: var(--primary);
}

.blog-cat-btn:active {
    transform: translateY(0);
}

/* ========================================
   BLOG ARTICLES GRID
   ======================================== */

.blog-grid-section {
    background: var(--bg-gray);
    padding: 80px 20px;
    min-height: 600px;
}

.blog-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.blog-card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: var(--bg-gray);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.08);
}

.blog-card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 16px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.blog-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-date {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-date::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.blog-card-title {
    font-size: 20px;
    line-height: 1.4;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
    color: var(--primary);
}

.blog-card-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    align-self: flex-start;
}

.blog-card-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-link svg {
    transform: translateX(4px);
}

.blog-no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-gray);
    grid-column: 1 / -1;
}

.blog-no-results svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.blog-no-results h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.blog-no-results p {
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
}

/* ========================================
   PAGINATION
   ======================================== */

.blog-pagination-section {
    background: var(--bg-gray);
    padding: 0 20px 60px;
}

.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.blog-page-btn {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-gray);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    padding: 0 12px;
}

.blog-page-btn:hover:not(.active):not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.blog-page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(28, 143, 166, 0.25);
}

.blog-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.blog-page-btn svg {
    width: 20px;
    height: 20px;
}

.blog-page-dots {
    padding: 0 8px;
    color: var(--text-light);
    font-weight: 600;
}

.blog-pagination-info {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-gray);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .blog-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        background-attachment: scroll !important;
        padding: 80px 20px !important;
        min-height: 450px !important;
    }
    
    .blog-hero-title {
        font-size: 36px !important;
    }
    
    .blog-hero-desc {
        font-size: 16px !important;
    }
    
    .blog-search-wrapper {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .blog-search-input {
        padding: 16px 16px 16px 48px !important;
    }
    
    .blog-search-btn {
        position: static !important;
        width: 100% !important;
        transform: none !important;
        padding: 16px !important;
    }
    
    .blog-search-btn:hover {
        transform: scale(1.02) !important;
    }
    
    .blog-search-icon {
        top: 16px !important;
        transform: translateY(0) !important;
    }
    
    .blog-categories {
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .blog-categories::-webkit-scrollbar {
        display: none;
    }
    
    .blog-articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .blog-grid-section {
        padding: 60px 20px;
    }
    
    .blog-pagination-section {
        padding: 0 20px 40px;
    }
    
    .blog-page-btn {
        min-width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 60px 20px !important;
    }
    
    .blog-hero-title {
        font-size: 28px !important;
    }
    
    .blog-badge {
        font-size: 10px !important;
        padding: 8px 18px !important;
    }
    
    .blog-card-title {
        font-size: 18px;
    }
    
    .blog-card-content {
        padding: 20px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-up {
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.blog-card:focus-within,
.blog-page-btn:focus,
.blog-cat-btn:focus,
.blog-search-input:focus,
.blog-search-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.blog-card:focus-within:not(:focus-visible),
.blog-page-btn:focus:not(:focus-visible),
.blog-cat-btn:focus:not(:focus-visible),
.blog-search-input:focus:not(:focus-visible),
.blog-search-btn:focus:not(:focus-visible) {
    outline: none;
}